package com.matt;

public class TestCommUtils {
    public static long strToLng(String strVal) {
        long V_0 = 0;
        try {
            String V_1 = String.format("%-8s", strVal).replace(' ', '0');
            String[] V_4 = new String[5];
            V_4[0] = "";  //for &h
            V_4[1] = strVal.substring(V_1.length() - 2);
            V_4[2] = strVal.substring(V_1.length() - 4, V_1.length() - 2);
            V_4[3] = strVal.substring(V_1.length() - 6, V_1.length() - 4);
            V_4[4] = strVal.substring(V_1.length() - 8, V_1.length() - 6);


            String concatStr = String.join("", V_4);
            int result = Integer.parseInt(concatStr, 16);
            V_0 = result;
        } catch (Exception ex) {
            throw ex;
        }
        return V_0;
    }

    public static void main(String[] args) throws NoSuchMethodException, NoSuchFieldException {
        long result = strToLng("90A2CF");
        System.out.println("got result for 90A2CF :: " + result);
    }
}
